import getDetailLocation from "@/utils/getDetailLocation";
import returnElement from "@/utils/elementType";
import operateOnTreeLevel from "./operateOnTreeLevel";
import arrayToFlat from "./arrayToFlat";
import clearCurrentAddComponentLocation from "./clearCurrentAddComponentLocation";
import useThrottle from "./throttle";

const getLocation = (e) => {
  const location = getDetailLocation(e);
  if (typeof location === "object")
    return { location: location?.location, key: location?.key || "" };
  return location;
};

export {
  getLocation,
  getDetailLocation,
  returnElement,
  operateOnTreeLevel,
  arrayToFlat,
  clearCurrentAddComponentLocation,
  useThrottle,
};
